#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 200005;

LL s;
int n, m;
LL w[N], v[N];
LL wsort[N];
int pre_n[N];
LL pre_v[N];
int ls[N],rs[N];
LL wmin = LLONG_MAX, wmax = 0;


LL check(int idx){
	pre_v[0]=0L;
    pre_n[0]=0;
    LL w0 = wsort[idx];
    for (int i = 1; i <= n; i++){
    	if(w[i]>w0){
    		pre_v[i]=pre_v[i-1]+v[i];
    		pre_n[i]=pre_n[i-1]+1;
		}
		else{
    		pre_v[i]=pre_v[i-1];
    		pre_n[i]=pre_n[i-1];			
		}
    }
    LL res=0;
    for(int i=1;i<=m;i++){
    	res += (pre_n[rs[i]]-pre_n[ls[i]-1])*(pre_v[rs[i]]-pre_v[ls[i]-1]);
	}
    return res;
}

int main(){
    scanf("%d%d%lld", &n, &m, &s);
    for (int i = 1; i <= n; i++){
        scanf("%lld%lld", &w[i], &v[i]);
        wsort[i] = w[i];
    }
    sort(wsort+1,wsort+n+1);
    for (int i = 1; i <=m; i++) scanf("%d%d", &ls[i], &rs[i]);

    int l=1,r=n,mid;
    LL ans = LLONG_MAX;
    while (l <= r){
        mid = (r - l) / 2 + l;
        LL temp = check(mid);
        if (temp < s){
            ans = min(ans, s - temp);
            r = mid - 1;
        }
        else if (temp == s){
            printf("0\n");
            return 0;
        }
        else{
            ans = min(temp - s, ans);
            l = mid + 1;
        }
    }
    printf("%lld\n", ans);
    return 0;
}
